package cn.itcast.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ErrorResult {

    private String errCode = "999999";
    private String errMessage;

    public static ErrorResult error() {
        return ErrorResult.builder().errCode("999999").errMessage("系统异常稍后再试").build();
    }

    public static ErrorResult queryFail() {
        return ErrorResult.builder().errCode("000001").errMessage("查询失败").build();
    }

    public static ErrorResult queryOK() {
        return ErrorResult.builder().errCode("000002").errMessage("查询成功").build();
    }

    public static ErrorResult addOk() {
        return ErrorResult.builder().errCode("000003").errMessage("添加成功").build();
    }

    public static ErrorResult addFail() {
        return ErrorResult.builder().errCode("000004").errMessage("添加失败").build();
    }
}
